package com.example.tenant.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.tenant.Converter.CustomStringConverter;
import com.example.tenant.Converter.LongStringConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 系统消息推送记录
 *
 * @author pig
 * @date 2023-10-25 18:07:23
 */
@Data
@ColumnWidth(10)
@TableName("sys_message_relation")
@EqualsAndHashCode(callSuper = true)
public class SysMessageRelationEntity extends Model<SysMessageRelationEntity> {

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ExcelProperty(value = "id", converter = LongStringConverter.class)
    private Long id;

    /**
     * 消息ID
     */
    @ExcelProperty(value = "msg_id", converter = LongStringConverter.class)
    private Long msgId;

    /**
     * 接收人ID
     */
    @ExcelProperty("user_id")
    private String userId;

    /**
     * 内容
     */
    @ExcelProperty("content")
    private String content;

    /**
     * 已读（0否，1是）
     */
    @ExcelProperty("read_flag")
    private String readFlag;

    /**
     * 创建人
     */
    @ExcelProperty(value = "create_by", converter = CustomStringConverter.class)
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 创建时间
     */
    @ExcelProperty("create_time")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty(value = "update_by", converter = CustomStringConverter.class)
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty("update_time")
    private Date updateTime;

    /**
     * 删除标记
     */

    @TableField(fill = FieldFill.INSERT)
    @ExcelProperty("del_flag")
    private String delFlag;

    /**
     * 租户id
     */
    @ExcelProperty(value = "tenant_id", converter = LongStringConverter.class)
    private Long tenantId;
}
